package com.itdachang.design.behavioral.visitor;

/**
 * @author gcq
 * @create 2022-02-16
 */
public class UpdatePackage implements Vistor {

    String ext = "";

    public UpdatePackage(String ext) {
        this.ext = ext;
    }

    @Override
    public void vistDisk(Disk disk) {
        disk.command  += ">>> " + ext;
    }

    @Override
    public void vistCPU(CPU cpu) {
        // 该属性为例子
        cpu.command += ">>> " + ext;
        // 装饰模式增强？
    }
}